package cn.wyd.shield.log;




import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;


@Component
public class ShieldLog {
    protected static Logger logger= LoggerFactory.getLogger(ShieldLog.class);
    public  void doLog(HttpServletRequest httpServletRequest) {
        StringBuilder sb = new StringBuilder();
        sb.append(httpServletRequest.getProtocol()+"    ")
                .append(httpServletRequest.getLocalAddr()).append(":").append(httpServletRequest.getLocalPort())
                .append("  "+httpServletRequest.getMethod()+"  ")
                .append(httpServletRequest.getRequestURL());

        logger.info(sb.toString());
    }
}
